package com.javajun.entity;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToOne;

@Entity
public class BookBorrow {

    private Integer id;
    // 借阅时间
    private String startTime;
    // 审核时间
    private String middleTime;
    // 还书时间
    private String finishTime;
    // 当前借阅记录状态
    private String state;
    private SysUser sysUser;
    private Book book;
    
    @Id
    @GeneratedValue(strategy=GenerationType.IDENTITY)
    public Integer getId() {
        return id;
    }
    public void setId(Integer id) {
        this.id = id;
    }
    public String getStartTime() {
        return startTime;
    }
    public void setStartTime(String startTime) {
        this.startTime = startTime;
    }
    public String getMiddleTime() {
        return middleTime;
    }
    public void setMiddleTime(String middleTime) {
        this.middleTime = middleTime;
    }
    public String getFinishTime() {
        return finishTime;
    }
    public void setFinishTime(String finishTime) {
        this.finishTime = finishTime;
    }
    public String getState() {
        return state;
    }
    public void setState(String state) {
        this.state = state;
    }
    
    @OneToOne(cascade=CascadeType.REFRESH, fetch=FetchType.EAGER)
    public SysUser getSysUser() {
        return sysUser;
    }
    public void setSysUser(SysUser sysUser) {
        this.sysUser = sysUser;
    }
    
    @OneToOne(cascade=CascadeType.REFRESH, fetch=FetchType.EAGER)
    public Book getBook() {
        return book;
    }
    public void setBook(Book book) {
        this.book = book;
    }
    @Override
    public String toString() {
        return "BookBorrow [id=" + id + ", startTime=" + startTime + ", middleTime=" + middleTime + ", finishTime="
                + finishTime + ", state=" + state + ", sysUser=" + sysUser + ", book=" + book + "]";
    }
    
    
}
